%                    Airfoil Data Thingy
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Written by: Jon Komperda   (JKompe2@uic.edu)
%             Ph.D Student / Research Assistant
%             Computational Multiphase Transport Laboratory
%             Department of Mechanical Engineering
%             University of Illinois at Chicago
%             Chicago, IL 60607
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Modified by:  David Gitz (davidgitz@gmail.com
%             
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Written for: AIAA Student Org
%
%             Do not use without explicit permission from
%             either the author or organization this program
%             was written for. Please cite the author for
%             any code/ideas/thought that was borrowed from
%             this work.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Any Global declarations go here
close all
clear all
clc

reply = input('Do you want to download/save Airfoil Data? Y/N [N]: ', 's');
if isempty(reply)
    reply = 'N';
end
if(strcmp(reply,'Y'))
    downloaddata;
end

reply = input('Do you want to read Airfoil Data? Y/N [N]: ', 's');
if isempty(reply)
    reply = 'N';
end
if(strcmp(reply,'Y'))
    readData;
end

reply = input('Proceed with Analysis? Y/N [N]: ', 's');
while(~strcmp(reply,'N'))
if isempty(reply)
    reply = 'N';
end
if(strcmp(reply,'Y'))
    airfoilanalysis
    disp('Original Airfoils: ')
    disp(length(AirFoils))
    disp('Filtered Airfoils: ')
    disp(length(myFoils))
    disp('Variable Name of Filtered Airfoils is: myFoils')
    pause
    reply = input('Proceed with Analysis? Y/N [N]: ', 's');
end

end

reply = input('Do you want to graph Airfoil Data? Y/N [N]: ', 's');
if isempty(reply)
    reply = 'N';
end
if(strcmp(reply,'Y'))
   drawgraphs;
end
    
% end
% for whichRe=1:length(airfoils(whichFoil).data)
%     fig = figure(whichRe)
%     plot(airfoils(whichFoil).data(whichRe).Cl,...
%         airfoils(whichFoil).data(whichRe).Cd,...
%         'LineWidth',2,'Color',colorOrder(whichRe,:),...
%         'DisplayName',num2str(airfoils(whichFoil).data(whichRe).Re));   
% end
% title(airfoils(whichFoil).name);
% xlabel('Cl')
% ylabel('Cd')
% set(gca,'FontSize',14);
% legend('show')
% 
% 
